package com.wortox.common;

import com.wortox.pojo.Fruit;

import java.util.List;

public class GetFruitPrice {

    public static Integer findPrice(String name) {
        List<Fruit> fruitPrice = com.wortox.setPrice.FruitPrice.getInstance().getFruitPrice();
        for (Fruit fruit : fruitPrice) {
            if(name.equals(fruit.getName()))
            return fruit.getPrice();
        }
        return -1;
    }
}
